
--解锁帧数
--japi.UnlockFps(true)
--关闭平台锁镜头距离
for a=1,12 do
    local player = ac.player[a]
    if player:is_player() then
        japi.RequestExtraBooleanData(43, player.handle, nil, nil, false, 1, 0, 0) 
    end
end

--处理宽屏
local message = ac.message
if message.client_online then
    local win_w = japi.DzGetWindowWidth()
    local win_h = japi.DzGetWindowHeight()
    if japi.IsWindowMode() then
        local w = math.floor(win_w/16)*16
        local h = math.floor(win_h/9) * 9
        if h/9>w/16 then
            w = h*1920 / 1080
        end
        local x = math.floor((win_w - w) / 2)
        local y = math.floor((win_h - h) / 2)
        japi.SetWindowSize(w,h)
        japi.SetWindowPos(x,y)
        --宽屏
        japi.DzEnableWideScreen(true)
    else
        --japi.SetWindowSize(win_w/0.6,win_h/0.6)
    end
end

local camera_distacen = 1200
local camera_distacen_min = 1200
local camera_distacen_max = 2000

ac.player.self:set_camera_field('镜头距离', camera_distacen, 0.1)
ac.hardware:on "鼠标滑轮滚动" (function (_,flag)
    local x, y = ac.hardware:get_mouse_pos()
    if ac.game:dispatch('本地-鼠标滚动', x, y) then
        return false 
    end 


    if flag then
        camera_distacen = camera_distacen - 50
    else
        camera_distacen = camera_distacen + 50
    end
    if camera_distacen > camera_distacen_max then
        camera_distacen = camera_distacen_max
    elseif camera_distacen < camera_distacen_min then
        camera_distacen = camera_distacen_min
    end


    local dis_now = camera_distacen
    ac.player.self:set_camera_field('镜头距离', dis_now, 0.1)

    return true
end)

